package com.project.bean;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.List;


/**
 * (Cart实体类)
 */
@TableName("t_shop")
public class ShopBean implements Serializable {
    /**购物车编号*/
    @TableId(value = "pk_shopId",type = IdType.AUTO)
    private Integer id;
    /**用户编号*/
    @TableField("fk_userId")
    private Integer userId;
    /**商品编号*/
    @TableField("fk_productId")
    private Integer productId;
    /**商品对象*/
    @TableField(exist = false)
    private ProductBean product;
    /**商品数量*/
    @TableField("s_num")
    private Integer num = 1;

    public ShopBean(Integer userId, Integer productId) {
        this.userId = userId;
        this.productId = productId;
    }

    public ShopBean() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public ProductBean getProduct() {
        return product;
    }

    public void setProduct(ProductBean product) {
        this.product = product;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    @Override
    public String toString() {
        return "ShopBean{" +
                "id=" + id +
                ", userId=" + userId +
                ", productId=" + productId +
                ", product=" + product +
                ", num=" + num +
                "}\n";
    }
}

